﻿@model PerformanceAssessment.Models.Assessment
@{
    ViewBag.Title = "Assessment";
}
@using PerformanceAssessment.Models;

<style>
    textarea
    {
        font:inherit;
    }
</style>
<h2>
    Assessment</h2>
@using (Html.BeginForm())
{
    <fieldset>
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.IdAssessmentPeriod)
        @Html.HiddenFor(model => model.FromDate)
        @Html.HiddenFor(model => model.ToDate)
        @Html.HiddenFor(model => model.IdEmployee)
        @Html.HiddenFor(model => model.IdManager)
        @Html.HiddenFor(model => model.IdAssessmentStatus)
        <div class="display-label">
            Review Period</div>
        <div class="display-field">
            From: @Html.Label("FromDate", Model.FromDate.ToShortDateString()) To: @Html.Label("ToDate", Model.ToDate.ToShortDateString())
        </div>
        <div class="display-label">
            Employee</div>
        <div class="display-field">
            @Html.Label(string.Format("{0} {1} {2}", Model.Employee.FirstName, Model.Employee.FirstLastName, Model.Employee.SecondLastName))
        </div>
        <div class="display-label">
            Manager</div>
        <div class="display-field">
            @Html.Label(string.Format("{0} {1}", Model.Manager.FirstName, Model.Manager.LastName))
        </div>
        <div class="display-label">
            Employee Comments</div>
        <div class="display-field">
            @if (Model.EditionAllowed(ViewBag.userType, UserType.Employee))
            {
                @Html.TextArea("EmployeeComments", Model.EmployeeComments, new { style = "width:600px;" })
            }
            else
            {
                @Html.Hidden("EmployeeComments")
                @Html.TextArea("EmployeeComments", Model.EmployeeComments, new { style = "width:600px;", disabled="true" })
            }
        </div>
        <div class="display-label">
            Manager Comments</div>
        <div class="display-field">
            @if (Model.EditionAllowed(ViewBag.userType, UserType.Manager))
            {
                @Html.TextArea("ManagerComments", Model.ManagerComments, new { style = "width:600px;" })
            }
            else
            {
                @Html.Hidden("ManagerComments")
                @Html.TextArea("ManagerComments", Model.ManagerComments, new { style = "width:600px;", disabled="true" })
            }
        </div>
    </fieldset>
    <div>
        @if (Model.EditionAllowed(ViewBag.userType, UserType.Manager, UserType.Employee))
        {
            <input type="submit" value="Save comments" />
        }
    </div>
}
<p>
    @Html.ActionLink("Back to Assessment", "Details", new { assessmentId = Model.ID })
</p>
